package com.example.mobile2030606148tdh0618;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.widget.Button;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
 private RecyclerView rvMainUsers;
 private Button btnMainInsert;
 private List<Users> list=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        list=new MyDataAdapter().QueryAll(this);
        rvMainUsers.setAdapter(new UsersRViewAdapter(list));
    }
    private void initView(){
        rvMainUsers=(RecyclerView)findViewById(R.id.rvMainUsers);
        rvMainUsers.setLayoutManager(new LinearLayoutManager(this));
        btnMainInsert=(Button)findViewById(R.id.btnMainInsert);
    }

}